package cn.kgc.springmvc02.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/5/5
 * @Description:  restful 设计风格
 *
 * /user?username=tom&pwd=123
 * /user?method=add
 *
 * /user    crud
 * /user    get      查询
 * /user    post     添加
 * /user/1  delete  删除
 * /user    put     修改
 */
@Controller
@RequestMapping("restful")
public class RestfulController {

    @GetMapping
    public String method1(){
        System.out.println("method1()");
        return "user";
    }

    @PostMapping
    public String method2(){
        System.out.println("method2()");
        return "user";
    }

}
